package com.alaia.order.controller;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.alaia.order.domain.MqMessage;
import com.alaia.order.service.IMqMessageService;
import com.alaia.common.web.controller.BaseController;
import com.alaia.common.web.domain.AjaxResult;
import com.alaia.common.web.page.TableDataInfo;

/**
 * 【请填写功能名称】Controller
 * 
 * @author Alaia
 * @date 2022-11-01
 */
@RestController
@RequestMapping("/order/message")
public class MqMessageController extends BaseController
{
    @Autowired
    private IMqMessageService mqMessageService;

    /**
     * 查询【请填写功能名称】列表
     */
    @GetMapping("/list")
    public TableDataInfo list(MqMessage mqMessage)
    {
        startPage();
        List<MqMessage> list = mqMessageService.selectMqMessageList(mqMessage);
        return getDataTable(list);
    }


    /**
     * 获取【请填写功能名称】详细信息
     */
    @GetMapping(value = "/{messageId}")
    public AjaxResult getInfo(@PathVariable("messageId") String messageId)
    {
        return AjaxResult.success(mqMessageService.selectMqMessageByMessageId(messageId));
    }

    /**
     * 新增【请填写功能名称】
     */
    @PostMapping
    public AjaxResult add(@RequestBody MqMessage mqMessage)
    {
        return toAjax(mqMessageService.insertMqMessage(mqMessage));
    }

    /**
     * 修改【请填写功能名称】
     */
    @PutMapping
    public AjaxResult edit(@RequestBody MqMessage mqMessage)
    {
        return toAjax(mqMessageService.updateMqMessage(mqMessage));
    }

    /**
     * 删除【请填写功能名称】
     */
	@DeleteMapping("/{messageIds}")
    public AjaxResult remove(@PathVariable String[] messageIds)
    {
        return toAjax(mqMessageService.deleteMqMessageByMessageIds(messageIds));
    }
}
